/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIComponents.dailyComponents;

import MainClasses.*;
import java.util.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
 *
 * @author andrewcutler
 */
public class DailyViewPanel extends JPanel{
    
    
    private JPanel panel;
    private ArrayList<DailyClassPanel> panels;
    private DailyHeaderPanel headerPanel;
    
    public DailyViewPanel(CourseManager manager)
    {
        super();
        JScrollPane scroll = new JScrollPane(new JPanel());
        panels = new ArrayList<DailyClassPanel>();
        this.setName("Daily View");
        panel = (JPanel) scroll.getViewport().getView();
        ArrayList<Course> courses = manager.getCourses();
        this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
        panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
        headerPanel = new DailyHeaderPanel();
        this.add(headerPanel);
        this.add(scroll);
        DailyClassPanel currentPanel = null;
        for(Course c : courses)
        {
            currentPanel = new DailyClassPanel(c);
            panels.add(currentPanel);
            panel.add(currentPanel);
        }
        
    }
    
    public void reset()
    {
        headerPanel.reset();
        for(DailyClassPanel p : panels)
        {
            p.reset();
        }
    }
    
    
}
